

#ifndef _GMDISPLAY_H
#define _GMDISPLAY_H

#include <BaseTypes/Triangles.h>
#include <BaseTypes/Polygons.h>
#include <BaseTypes/Nurbs.h>
#include <boost/foreach.hpp>

#include <nurbs++/nurbsS.h>
#include <nurbs++/vector.h>

using namespace geomagick;

class gmGLDisplay
{
public:
	gmGLDisplay()
	{
		rtrx = 0;
		rtry = 0;
		ModeMouseClicked = false;
		shift = -80.0f;
		stage = 0.0f;
		fwd = false;
		bwd = false;
		ctrlPnts = false;
		showModel = false;
	}
        int init();
	void display(Triangles* Model);
	void display(Polygons* Model);
	void display(Nurbs* Model);
private:
	void draw();
	void mainloop();
	vector<Triangles*> TriangleModels;
	vector<Polygons*> PolygonModels;
	vector<Nurbs*> NurbsModels;
	void renderTriangleModel(Triangles* Model);
	void renderPolygonModel(Polygons* Model);
	void renderNurbsModel(Nurbs* Model);
	int handleInput();
	float rtrx;
	float rtry;
	float shift;
	float stage;
	bool fwd;
	bool bwd;
	bool  ModeMouseClicked;
	bool ctrlPnts;
	bool showModel;
	bool mode_m;
	GLUnurbsObj *theNurbs;
};

#endif /* _GMDISPLAY_H */
